package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

/**
 * 医生信息表
 * @TableName doctor_info
 */
@TableName(value ="doctor_info")
@Data
public class DoctorInfo {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 医生姓名
     */
    private String doctorName;

    /**
     * 医生头像（图片路径）
     */
    private String avatar;

    /**
     * 院区（东院/西院）
     */
    private String hospitalArea;

    /**
     * 职称（如主任医师、主治医师）
     */
    private String title;

    /**
     * 科室（内科/外科）
     */
    private String department;

    /**
     * 科室位置（如1号楼三楼）
     */
    private String departmentLocation;

    /**
     * 医生简介
     */
    private String introduction;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DoctorInfo other = (DoctorInfo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getDoctorName() == null ? other.getDoctorName() == null : this.getDoctorName().equals(other.getDoctorName()))
            && (this.getAvatar() == null ? other.getAvatar() == null : this.getAvatar().equals(other.getAvatar()))
            && (this.getHospitalArea() == null ? other.getHospitalArea() == null : this.getHospitalArea().equals(other.getHospitalArea()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getDepartment() == null ? other.getDepartment() == null : this.getDepartment().equals(other.getDepartment()))
            && (this.getDepartmentLocation() == null ? other.getDepartmentLocation() == null : this.getDepartmentLocation().equals(other.getDepartmentLocation()))
            && (this.getIntroduction() == null ? other.getIntroduction() == null : this.getIntroduction().equals(other.getIntroduction()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getDoctorName() == null) ? 0 : getDoctorName().hashCode());
        result = prime * result + ((getAvatar() == null) ? 0 : getAvatar().hashCode());
        result = prime * result + ((getHospitalArea() == null) ? 0 : getHospitalArea().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getDepartment() == null) ? 0 : getDepartment().hashCode());
        result = prime * result + ((getDepartmentLocation() == null) ? 0 : getDepartmentLocation().hashCode());
        result = prime * result + ((getIntroduction() == null) ? 0 : getIntroduction().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", doctorName=").append(doctorName);
        sb.append(", avatar=").append(avatar);
        sb.append(", hospitalArea=").append(hospitalArea);
        sb.append(", title=").append(title);
        sb.append(", department=").append(department);
        sb.append(", departmentLocation=").append(departmentLocation);
        sb.append(", introduction=").append(introduction);
        sb.append(", createTime=").append(createTime);
        sb.append("]");
        return sb.toString();
    }
}